<?php
if (!defined('W_ROOT')) {
	exit();
}
$position = isset($_GET['position'])?$_GET['position']:'';
	$erro = (isset($_GET['error']))?$_GET['error']:'';
	switch($erro){
		case'invalid_file':
			$error_msg = '<div class="warning">'.$lang['MSG_INVALID_FILE'].'</div>';
		break;
		case'invalid_url':
			$error_msg = '<div class="warning">'.$lang['MSG_INVALID_URL'].'</div>';
		break;
		case'date_error':
			$error_msg = '<div class="warning">'.$lang['DATE_POST_ERROR'].'</div>';
	}
?>
<div class="breadcrumb">
        <a href="<?php echo base_url_admin;?>"><?php echo $lang['HOME'];?></a>
         ::<a href="index.php?view=list"><?php echo $lang['ADVERTISE_MANAGE']; ?></a>
      	 ::<?php echo $lang['NEW_ADVER']; ?>
      </div>
<div class="box">
	<?php
		echo '<div class="message_contain">';
			echo @$error_msg;
		echo '</div>';
	 ?>
<div class="heading">
	<h1><img src="../templates/image/report.png" alt="" />

			<?php echo $lang['NEW_ADVER']; ?>&nbsp;&nbsp;&nbsp;<span class="required">(*) all asterisks must be required!</span>

	</h1>
	<div class="buttons">
	<form action="<?php echo base_url_admin;?>/advertise/process.php?action=add"  method="post" name="frmlist"  id="commentForm" enctype="multipart/form-data">
	<input class="button" type="submit" name="btnsave" value="<?php echo $lang['SAVE']; ?>"/>&nbsp;&nbsp;&nbsp;
<input class="button" type="reset" name="btnreset" value="<?php echo $lang['RESET']; ?>" />&nbsp;&nbsp;&nbsp;
<input class="button" type="button" name="btncancel" value="<?php echo $lang['CANCEL']; ?>" onClick="javascript:window.history.back();" /><br/>
	</div>
	</div>
	<div class="content">
<div class="row">
<table cellpadding="5" cellspacing="5" border="0" width="100%" align="center">
<tr>
   <td width="10%" height="30" align="left" valign="top"><?php echo $lang['ADDVER_TITLE']; ?>&nbsp;&nbsp;<strong style="color:#F00;">*</strong></td>
   <td width="5%" align="left" valign="top">:</td>
   <td width="80%" align="left">
        <input name="txttitle" type="text" placeholder="<?php echo $lang['ADDVER_TITLE']; ?>" id="txttitle" value="<?php echo @$_SESSION['title']?@$_SESSION['title']:''?>" required />
   </td>
</tr>
<tr>
   <td width="10%" height="30" align="left" valign="top"><?php echo $lang['UP_IMG']; ?> &nbsp;&nbsp;<span style="color:#F00;"> *</span></td>
   <td width="5%" align="left" valign="top">:</td>
   <td width="80%" align="left">
    <input name="txtimage" type="file" required value="<?php echo (isset($_GET['image']))?$_GET['image']:""; ?>"/><br />
   </td>

</tr>
<tr>
   <td width="10%" height="30" align="left" valign="top"><?php echo $lang['ADD_LINK_IMG']; ?> &nbsp;&nbsp;<span style="color:#F00;">*</span></td>
   <td width="5%" align="left" valign="top">:</td>
   <td width="80%" align="left">
        <input name="txtaddlink" placeholder="<?php echo $lang['ADD_LINK_IMG']; ?>"  type="text"  id="txtmeta_desc" required value="<?php echo @$_SESSION['link']?@$_SESSION['link']:'' ?>" /> &nbsp;&nbsp;<span style="color:#F00;"><?php echo $lang['NOTE_GOOGLE']; ?></span>
   </td>
</tr>

<tr>
   <td width="10%" height="30" align="left" valign="top"><?php echo $lang['DATE_POST']; ?>&nbsp;&nbsp;<strong style="color:#F00;">*</strong></td>
   <td width="5%" align="left" valign="top">:</td>
   <td width="80%" align="left">
        <input name="txtpost" type="text" placeholder="<?php echo $lang['DATE_POST']; ?>"  id="datepicker" required value="<?php echo @$_SESSION['postdate']?@$_SESSION['postdate']:'' ?>"/>
   </td>
</tr>
<tr>
   <td width="10%" height="30" align="left" valign="top"><?php echo $lang['DATE_END_POST']; ?>&nbsp;&nbsp;<strong style="color:#F00;">*</strong></td>
   <td width="5%" align="left" valign="top">:</td>
   <td width="80%" align="left">
        <input name="txtendpost"  placeholder="<?php echo $lang['DATE_END_POST']; ?>" class="datepicker" type="text"  required value="<?php echo @$_SESSION['enddate']?@$_SESSION['enddate']:'' ?>"/>
   </td>
</tr>
<tr>
   <td width="10%" height="30" align="left" valign="top"><?php echo $lang['DISCRIPTION']; ?></td>
   <td width="5%" align="left" valign="top">:</td>
   <td width="80%" align="left">


        <textarea  name="txtdescription" style="width:30%;height:100px;" placeholder="Description"><?php echo @$_SESSION['desc']?@$_SESSION['desc']:'' ?></textarea>

   </td>
</tr>
<tr>
<td width="10%" height="30" align="left" valign="top"><?php echo $lang['POST_PAGE']; ?>&nbsp;&nbsp;<strong style="color:#F00;">*</strong></td>
<td width="5%" align="left" valign="top">:</td>
<td width="80%" align="left">
 <select name="txtpage" style="width:300px;" required >
		<?php $page = @$_SESSION['page'];?>
	   <option value="">-------------<?php echo $lang['sel_position']; ?>---------------</option>
	   <option value="0" <?php echo ($page=='0')?'selected="selected"':''?> ><?php echo $lang['HOME']; ?></option>
	   <option value="1" <?php echo ($page=='1')?'selected="selected"':''?>><?php echo $lang['SUB']; ?></option>
 </select>
</td>
</tr>
<tr>
<td width="10%" height="30" align="left" valign="top"><?php echo $lang['POSITION']; ?>&nbsp;&nbsp;<strong style="color:#F00;">*</strong></td>
<td width="5%" align="left" valign="top">:</td>
<td width="80%" align="left">
 <select name="txtposition" style="width:300px;" required >
 		<?php $position = @$_SESSION['position']; ?>
	   <option value="">-------------<?php echo $lang['sel_position']; ?>---------------</option>
	   <option value="right" <?php echo ($position=="right")?'selected="selected"':''?> ><?php echo $lang['RIGHT']; ?></option>
	   <option value="left" <?php echo ($position=="left")?'selected="selected"':''?>><?php echo $lang['LEFT']; ?></option>
	   <option value="content" <?php echo ($position=="content")?'selected="selected"':''?>><?php echo $lang['CONTENT']; ?></option>
	   <option value="bottom" <?php echo ($position=="bottom")?'selected="selected"':''?>><?php echo $lang['BOTTOM']; ?></option>
 </select>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>
</form>
</div>
</div>
</div>